-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vectorize basic_string::find_last_of
#4934
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
…lignment specifier".
Thanks! I pushed small but significant changes, please double-check. Final results on my 5950X, I see only one number of concern, not enough to block this PR. Click to expand table:
The case |
Thanks for noticing alignment problem!
This case regressed in my bencnhmark too, both in original benchmark and in today retest, but not as much as for you. This is the case where we use bitmap. Apparently after some added code the bitmap loop has got more unfortunate alignment. |
For _last_of it is never correct to subtract _Start_at from something, the range is on the other side from _Start_at (+1 because inclusive)
... to avoid merge conflicts with microsoftGH-4934. This partially reverts commit 8d902d9.
Indentation is a limited resource. Think of the children!
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Pushed changes to fix the benchmark UB that @AlexGuteniev noticed - the |
Now streaming on Max, the new season of Find Last Of Us! 📺 🧟 🍄 |
🧭 Overview
pcmpestri
approach as infind_first_of
for 1 or 2 byte element. Did not bother making anything for larger characters.find_first_of
was a bit copypasta reduced. Still the_first_
and the_last_
don't share the implementation, it would have been very confusing to iterate in different directions in a single loop._pos
in names to indicate being position based rather than pointer based. They are used in strings only, so pointers would have been extra conversion for no gain. We might add position-basedfind_first_of
or pointer basedfind_last_of
someday, so the naming scheme has provision for this.basic_string<unsigned long long>
.⏱️ Benchmark results